from tkinter import *

root = Tk()
root.title('单选')
root.geometry('200x200+200+200')
# 单选按例
v1 = StringVar()
v1.set('默认选择')
op = OptionMenu(root,v1,'选择一','选择二','默认选择')
op['width']=100
op.pack()

def test():
    lable = Label(root)
    lable['text'] = v1.get()
    lable.pack()

button = Button(root,text='确定',command=test)
button.pack()

# 滑块案件，通过滑块来控制字体大小,注意这里的函数传参，是用来获取滑块的值
# def test1(value):
#     print('滑块的值%s'%value)
#     newfont = ('宋体',value)
#     s2.config(font=newfont)

# s1 = Scale(root,command=test1)
# s1['from'] = 10;s1['to'] = 50;s1['length']=200;s1['tickinterval']=5;s1['orient']=HORIZONTAL  #  HORIZONTAL水平排列，默认是竖直
# s1.pack()

# s2 = Label(root,text='字体会变大',bg='yellow',width=20,height=20)
# s2.pack()

root.mainloop()